package com.xywy.bloodandroid.act;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xywy.bloodandroid.R;
import com.xywy.bloodandroid.base.BaseActivity;
import com.xywy.bloodandroid.bean.BloodPressureData;

public class BloodInfoAct extends BaseActivity {
   private TextView tv_blood;
   private TextView tv_from;
   private TextView tv_date;
   private TextView tv_input;
   BloodPressureData bloodData ;
   private RelativeLayout back;
   private TextView tv_middle;
	@Override
	protected void initView(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
        setContentView(R.layout.blood_info);
        tv_blood = (TextView) findViewById(R.id.tv_blood);
        tv_from = (TextView) findViewById(R.id.tv_from);
        tv_date = (TextView) findViewById(R.id.tv_date);
        tv_input = (TextView) findViewById(R.id.tv_input);
        bloodData = getIntent().getParcelableExtra("data");
        back = (RelativeLayout) findViewById(R.id.left_img);
        back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				finish();
			}
		});
        tv_middle = (TextView) findViewById(R.id.middle_title);
        tv_middle.setText("详细信息");
	}

	@Override
	protected void initListener() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void initData() {
		tv_blood.setText(bloodData.getHighPressure()+"");
		tv_from.setText("欧姆龙"+"");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		tv_date.setText(sdf.format(new Date(bloodData.getDate()))+"");
		tv_input.setText("是");
		tv_blood.setText(bloodData.getHighPressure()+"");
	}

}
